/**
 * 
 */
package com.xbang.attendance.entity.system;

import java.io.Serializable;
import java.math.BigDecimal;
import java.util.Date;

import javax.persistence.CascadeType;
import javax.persistence.Entity;
import javax.persistence.FetchType;
import javax.persistence.GeneratedValue;
import javax.persistence.GenerationType;
import javax.persistence.Id;
import javax.persistence.JoinColumn;
import javax.persistence.ManyToOne;

import com.xbang.attendance.entity.product.Product;

/**
 * @author dev.zhang
 * 
 *         仓库产品各种约定配置
 */
@Entity
public class WarehouseProductAgreement implements Serializable {

	private static final long serialVersionUID = 47071770253877635L;

	@Id
	@GeneratedValue(strategy = GenerationType.AUTO)
	private Integer id;

	@ManyToOne(cascade = { CascadeType.MERGE }, targetEntity = Product.class, fetch = FetchType.EAGER)
	@JoinColumn(columnDefinition = "product", referencedColumnName = "id")
	private Product product;

	@ManyToOne(cascade = { CascadeType.MERGE }, targetEntity = Warehouse.class, fetch = FetchType.EAGER)
	@JoinColumn(columnDefinition = "warehouse", referencedColumnName = "id")
	private Warehouse warehouse;
	private Date lastModifyVirtualDate;
	
	public Date getLastModifyVirtualDate() {
		return lastModifyVirtualDate;
	}

	public void setLastModifyVirtualDate(Date lastModifyVirtualDate) {
		this.lastModifyVirtualDate = lastModifyVirtualDate;
	}

	/** 数量 */
	private BigDecimal number;
	
	/**最后更改时间*/
	private Date lastModifyDate;
	
	/**虚拟数量*/
	private BigDecimal virtualNumber;
	/**
	 * @return the id
	 */
	public Integer getId() {
		return id;
	}

	public Date getLastModifyDate() {
		return lastModifyDate;
	}

	public void setLastModifyDate(Date lastModifyDate) {
		this.lastModifyDate = lastModifyDate;
	}

	/**
	 * @param id
	 *            the id to set
	 */
	public void setId(Integer id) {
		this.id = id;
	}

	/**
	 * @return the product
	 */
	public Product getProduct() {
		return product;
	}

	/**
	 * @param product
	 *            the product to set
	 */
	public void setProduct(Product product) {
		this.product = product;
	}

	/**
	 * @return the warehouse
	 */
	public Warehouse getWarehouse() {
		return warehouse;
	}

	/**
	 * @param warehouse
	 *            the warehouse to set
	 */
	public void setWarehouse(Warehouse warehouse) {
		this.warehouse = warehouse;
	}

	/**
	 * @return the number
	 */
	public BigDecimal getNumber() {
		return number;
	}

	/**
	 * @param number
	 *            the number to set
	 */
	public void setNumber(BigDecimal number) {
		this.number = number;
	}

	public BigDecimal getVirtualNumber() {
		return virtualNumber;
	}

	public void setVirtualNumber(BigDecimal virtualNumber) {
		this.virtualNumber = virtualNumber;
	}

}
